#! /bin/bash
oldpath=`pwd`
zipFile=ipdb.zip
datapath=/FC_BAYERN/data
dataDir=ipdb
backupspath=/FC_BAYERN/data
backupsDir=ipdb-backups

if [ ! -f $oldpath/$zipFile ]; then
	echo "$oldpath/$zipFile is not exists"
	exit $?
fi

cd $datapath

rm -rf $backupspath/$backupsDir
ls -d $datapath/$dataDir && mv $datapath/$dataDir $backupspath/$backupsDir || echo "$datapath/$backupsDir is not exists"
rm -rf $datapath/$dataDir

mkdir $dataDir
unzip $oldpath/$zipFile -d $dataDir
